<?php
if (! defined ( 'BASEPATH' ))
	exit ( 'No direct script access allowed' );

// ------------------------------------------------------------------------


/**
 * 格式化查询结果，返回一般的数组格式！
 *
 * @access	public
 * @param	array
 * @param	array
 * @return	array
 */
if (! function_exists ( 'formatQueryList' )) {
	function formatQueryList($QueryList, $ColumnName=array()) {
		$listLn = count ( $QueryList );
		$columLn = count ( $ColumnName );
		if ($columLn <= 0 || $listLn <= 0) {
			return $QueryList;
		}
		$RList=array();
		$CList=array();
		for($index = 0; $index < $listLn; $index ++) {
			for($c_index = 0; $c_index < $columLn; $c_index ++) {
				$CList[$ColumnName[$c_index]] = $QueryList [$index]->$ColumnName[$c_index];
			}
			array_push($RList,$CList);
		}
		return $RList;
	}
}



